<template>
	<view class="coach_list">
		<!--左边虚化-->
		<!-- <view class="hide-content-box hide-content-box-left"></view> -->
		<!--右边虚化-->
		<!-- <view class="hide-content-box hide-content-box-right"></view> -->
		<scroll-view scroll-x="true" class="kite-classify-scroll">
			<view class="kite-classify-cell" v-for="(item,index) in courseList" :key="index" @click="route(item)">
				<view class="head_portrait">
					<image :src="item.image" mode="aspectFill" class="img"></image>
				</view>
				<view class="deatil">
					<view class="name">
						{{item.title}}
					</view>
					<view class="reputation">
						好评率{{item.vea}}
					</view>
					<view class="skill_box">
						<view v-for="(skillItem,skillIndex) in item.label_list" :key="skillindex" class="item">
							{{skillItem.title}}
						</view>
					</view>
					<view class="price_bottom">
						<text class="color1 size1">￥</text>
						<text class="color1 size2">{{item.price}}</text>
						<text class="color1 size1">/{{item.unit}}</text>
						<text class="color2 size1" v-if="item.cost" style="margin-left: 10rpx;">￥{{item.cost}}/{{item.unit}}</text>
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		props:{
			courseList:{
				type:Array,
				default:[],
				required:true	
			}
		},
		data() {
			return {

			}
		},
		methods: {
			route(item){
				uni.navigateTo({
					url:'/pageA/course/detail?course='+item.course
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.coach_list {
		position: relative;
		white-space: nowrap;
		width: 654rpx;
	}
	/*左右渐变遮罩*/
	.hide-content-box {
		position: absolute;
		top: 0;
		height: 100%;
		width: 10px;
		z-index: 2;
	}
	
	.hide-content-box-left {
		left: 0;
		background-image: linear-gradient(to left, rgba(255, 255, 255, 0),  #ffffff 60%);
	}
	
	.hide-content-box-right {
		right: 0;
		background-image: linear-gradient(to right, rgba(255, 255, 255, 0),  #ffffff 60%);
	}
	.kite-classify-scroll {
		width: 100%;
		height: 460rpx;
		overflow: hidden;
		white-space: nowrap;
	}
	.kite-classify-cell{
		display: inline-block;
		background: #f6f6f6;
		border-radius: 16rpx;
		// box-shadow: 2px 2px 3px rgba(26, 26, 26, 0.2);
		width: 480rpx;
		height: 460rpx;
		margin-right: 12rpx;
	}
	
	.head_portrait{
		width: 480rpx;
		height: 240rpx;
		border-radius: 16rpx;
		overflow: hidden;
		position: relative;
		.img{
			width: 100%;
			height: 100%;
		}
	}

	.deatil{
		display: flex;
		flex-direction: column;
		height: 220rpx;
		padding: 20rpx 0 0 24rpx;
		.name{
			font-size: 32rpx;
			font-family: PingFang SC, PingFang SC-Bold;
			font-weight: 700;
			color: #000000;
		}
		.reputation{
			margin-top: 6rpx;
			font-size: 20rpx;
			font-weight: 400;
			color: #666666;
		}
		.skill_box{
			margin-top: 12rpx;
			display: flex;
			flex-direction: row;
			align-items: center;
			.item{
				margin-right: 6rpx;
				height: 28rpx;
				background: #ededed;
				border-radius: 4rpx;
				padding: 0 6rpx;
				font-size: 20rpx;
				font-weight: 500;
				color: #666666;
			}
		}
		
		.price_bottom{
			margin-top: 14rpx;
			display: flex;
			flex-direction: row;
			align-items: baseline;
			.color1{
				color: #F37364;
			}
			.size1{
				font-size: 24rpx
			}
			.size2{
				font-size: 32rpx;
			}
			.size3{
				font-size: 20rpx;
			}
			.color2{
				color: #999999;
				text-decoration:  line-through;
			}
		}
	}
</style>